func subdomainVisits(cpdomains []string) []string {
	hashTable := make(map[string]int, 0)
	for _, value := range cpdomains {
		//分离数字和域名
		splits := strings.Split(value, " ")
		//将string变为int
		num, _ := strconv.Atoi(splits[0])
		for {
			hashTable[splits[1]] += num
			//寻找.若找不到则循环结束，若找到则取其右边部分
			dot := strings.Index(splits[1], ".")
			if dot < 0 {
				break
			}
			splits[1] = splits[1][dot+1:]
		}
	}
	//遍历哈希表将答案输出
	res := make([]string, 0, len(hashTable))
	for key, value := range hashTable {
		res = append(res, fmt.Sprintf("%d %s", value, key))
	}
	return res
}
